import React from 'react'

function MyComponent() {
    console.log('MyComponent 更新了');
    return (
    <div>
      MyComponent
    </div>
  )
}
const setSatisfactionClass = (level) => {
    if (level < 100) {
        return "very-dissatisfied";
    }
    if (level < 200) {
        return "somewhat-dissatisfied";
    }
    if (level < 300) {
        return "neither";
    }
    if (level < 400) {
        return "somewhat-satisfied";
    }
    return "very-satisfied";
}
// props level
const isSameRange = (preveValue, nextValue) => {
    // console.log(preveValue, nextValue, '/////');
    const prevValueClass = setSatisfactionClass(preveValue.level);
    const nextValueClass = setSatisfactionClass(nextValue.level);
    return preveValue === nextValueClass
}
// 
export default React.memo(MyComponent, isSameRange)
